package com.bishe.demo.modules.hotel.hotelFacilityAndService.dao;

import com.bishe.demo.modules.hotel.hotelFacilityAndService.entity.FacilityUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface FacilityUserDao {
    @Insert("insert into hotel_facility_user values(null,#{facilityId},#{userId})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void insertFacilityUser(FacilityUser facilityUser);

    @Delete("delete from hotel_facility_user where user_id=#{userId}")
    void deleteByUserId(int userId);
}
